package com.shuaigequtan.nacos.order.controller;


import com.shuaigequtan.result.MsgResponseBody;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@RequestMapping("/consumer")
public class ConsumerCtrol {
    private static String PAYMENTURL = "http://cloud-nacos-payment";
    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/getPayment/{id}")
    public MsgResponseBody getPaymet(@PathVariable("id") Long id){
        System.out.println("adada");
        return restTemplate.getForObject(PAYMENTURL+"/payment/getPayment/"+id+"?userName=123", MsgResponseBody.class);
    }
}
